package com.jt.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.stereotype.Component;

@Component
@Data//lombok插件注解自动set/get方法
@NoArgsConstructor//无参构造
@AllArgsConstructor//全参构造
@Accessors(chain = true)//开启链式加载（重写set（）方法）
public class User {
    private Integer id;
    private String name;
    private Integer age;
    private String addr;

//    链式加载的源码
//      this 代表当前对象
//    public User setId(Integer id){
//        this.id = id;
//        return this;
//    }public User setName(String name){
//        this.name = name;
//        return this;
//    }public User setAge(Integer age){
//        this.age = age;
//        return this;
//    }public User setAddr(String addr){
//        this.addr = addr;
//        return this;
//    }
}
